<%- include('../common/header.html', {title: "websocket连接"}) %>
<div>
  <h1>WebSocket连接</h1>
  <p>
    <span>连接状态：</span>
    <span id="status" style="color: #f00;">未连接</span>
  </p>
  <p>
    <span>连接地址：</span>
    <input id="wsurl" type="text" value="ws://localhost:9674/ws" style="width: 500px;" />
    <button onclick="connectWs()">连接</button>
    <button onclick="disconnectWs()">断开</button>
  </p>
  <p>
    <span>消息内容：</span>
    <input id="message" type="text" style="width: 500px;" />
    <button onclick="send()">发送</button>
  </p>
  <div id="container"></div>
</div>
<%- include('../common/footer.html') %>

<script src="/static/js/ws.js"></script>
